<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <h:head>
        <title>Crear Roles</title>
        <link rel="stylesheet" href="Data\\CSS\\content.css" type="text/css"/>
        <link rel="stylesheet" href="Data\\CSS\\ui-layout.css" type="text/css"/>
    </h:head>
    <h:body>
        <p:growl id="msgCR" showDetail="true" autoUpdate="true" life="7000"/> 
        <h:outputText value="Nombre del Rol: "/><label for="report">*</label>
        <p:inputText value="#{createRolBean.currentRol.role}" required="true"/>
        <br />
        
        <label for="subtitle">Lista de Privilegios</label>  
        <p:pickList id="pojoPickList" value="#{createRolBean.privileges}" 
                    var="privilege" effect="bounce"
                    itemValue="#{privilege}" itemLabel="#{privilege}" 
                    showSourceControls="false" showTargetControls="false" 
                    showSourceFilter="true" showTargetFilter="true" 
                    showCheckbox="true" filterMatchMode="contains" >  

            <f:facet name="sourceCaption">Disponibles</f:facet>  
            <f:facet name="targetCaption">Agregados</f:facet>  

            <p:ajax event="transfer" listener="#{createRolBean.onTransfer}" update="msgCR" />  


            <p:column style="width:90%;">  
                #{privilege}  
            </p:column>  

        </p:pickList> 
        
        <p:commandButton id="rolSubmit" value="Crear" 
                         action="#{createRolBean.create()}" 
                         style="margin-top:5px" ajax="false"
                         update="msgCR"/>  
  
    </h:body>
</html>
